/**
 * 
 */
package com.nari.heatassist.service;

import java.util.List;
import java.util.Map;

import com.nari.baseinfo.model.IHeatMeter;
import com.nari.coreframe.service.IGenericService;
import com.nari.heatassist.model.IBuildingConsumeConfig;
import com.nari.heatassist.utils.BuildingConsumeConfigEntity;
import com.nari.platform.model.PageCond;
import com.nari.platform.model.ResponseMsg;
import com.nari.platform.model.ResultWithPageCond;

/**
 * 
 * @author Xiaopeng
 * @date 2014-4-22
 */
public interface IBuildingConsumeConfigService extends IGenericService<IBuildingConsumeConfig, String> {

	/**
	 * 分页查询楼栋耗热配置项
	 * @param projectUID
	 * @param communityUID
	 * @param buildingUID
	 * @param pageCond
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public ResultWithPageCond<BuildingConsumeConfigEntity> queryConsumeConfigPage(String projectUID, 
			String communityUID, String buildingUID, PageCond pageCond) throws Exception;
	
	/**
	 * 通过楼栋耗热配置查询与之关联的小区ID-小区名称映射表
	 * @param configList
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public Map<String, String> queryReferCommunitysByConfigList(List<BuildingConsumeConfigEntity> configList) throws Exception;
	
	/**
	 * 通过楼栋耗热配置查询与之关联的楼栋ID-楼栋名称映射表
	 * @param configList
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public Map<String, String> queryReferBuildingsByConfigList(List<BuildingConsumeConfigEntity> configList) throws Exception;
	
	/**
	 * 通过楼栋耗热配置查询与之关联的楼栋ID-楼栋名称映射表
	 * @param configList
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public Map<String, String> queryReferBuildingsByMeasureConfigList(List<IBuildingConsumeConfig> configList) throws Exception;
	
	/**
	 * 分页查询参与楼栋热计量的配置列表
	 * @param buildingUID
	 * @param meterNo
	 * @param pageCond
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public ResultWithPageCond<IBuildingConsumeConfig> queryMeasureMeterPage(String buildingUID, String meterNo, 
			PageCond pageCond) throws Exception;
	
	/**
	 * 通过楼栋信息删除楼栋耗热计量配置项
	 * @param buildingUID
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-23
	 */
	public ResponseMsg deleteBuildingConsumeConfig(String buildingUID) throws Exception;
	
	/**
	 * 查询可用于楼栋耗热配置的热表列表，剔掉已参与该楼栋配置的热量表
	 * 根据楼栋与热表的物理关系(主干、分支等关系)，只要热表与楼栋在同一小区，即可进行逻辑关系配置
	 * @param projectUID
	 * @param communityUID
	 * @param meterNo
	 * @param buildingUID
	 * @param pageCond
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-24
	 */
	public ResultWithPageCond<IHeatMeter> queryConfigMeasureMeterPage(String projectUID, 
			String communityUID, String meterNo, String buildingUID, 
			PageCond pageCond) throws Exception;
	
	/**
	 * 保存楼栋耗热计量的热量表关系配置
	 * @param buildingUID
	 * @param meterOptions 热量表选项及其设置信息
	 * 	格式(热量表ID:热量表加减关系)：XXX:XXX,XXX:XXX,XXX:XXX
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-24
	 */
	public ResponseMsg saveOrUpdateBuildingMeasureMeterConfig(String buildingUID, 
			String meterOptions) throws Exception;
	
	/**
	 * 通过楼栋与热量表的关联关系删除配置项
	 * @param buildingUID
	 * @param meterNo
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-4-24
	 */
	public ResponseMsg deleteConfigByRelation(String buildingUID, 
			String meterNo) throws Exception;
}
